package com.gupao.study.observer;

import com.google.common.eventbus.EventBus;

public class Test {
    public static void main(String[] args) {
        EventBus eventBus = new EventBus();

        Teacher tomTeacher = new Teacher("tom");
        Teacher jamesTeacher = new Teacher("james");
        eventBus.register(tomTeacher);
        eventBus.register(jamesTeacher);

        Student student  = new Student("小明","怎么使用EventBus");
        eventBus.post(student);

    }
}
